﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Diagnostics;
using Microsoft.Win32;

namespace Viet_Calculator
{
	/// <summary>
	/// Summary description for ThongTinMayTinh.
	/// </summary>
	public class ThongTinMayTinh : System.Windows.Forms.Form
	{
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.LinkLabel linkLabel1;
		private System.Windows.Forms.Label lblDoPhanGiai;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label lblBoViXuLy;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Label lblCongNgheNen;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label lblHeDieuHanh;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label lblTenMayTinh;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label lblGioHienTai;
		private System.Windows.Forms.Label lblNgayHienTai;
		private System.Windows.Forms.Label label1;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public ThongTinMayTinh()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ThongTinMayTinh));
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.linkLabel1 = new System.Windows.Forms.LinkLabel();
			this.lblDoPhanGiai = new System.Windows.Forms.Label();
			this.label7 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.lblBoViXuLy = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.lblCongNgheNen = new System.Windows.Forms.Label();
			this.label5 = new System.Windows.Forms.Label();
			this.lblHeDieuHanh = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.lblTenMayTinh = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.lblGioHienTai = new System.Windows.Forms.Label();
			this.lblNgayHienTai = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.groupBox1.SuspendLayout();
			this.SuspendLayout();
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.linkLabel1);
			this.groupBox1.Controls.Add(this.lblDoPhanGiai);
			this.groupBox1.Controls.Add(this.label7);
			this.groupBox1.Controls.Add(this.label3);
			this.groupBox1.Controls.Add(this.lblBoViXuLy);
			this.groupBox1.Controls.Add(this.label6);
			this.groupBox1.Controls.Add(this.lblCongNgheNen);
			this.groupBox1.Controls.Add(this.label5);
			this.groupBox1.Controls.Add(this.lblHeDieuHanh);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.lblTenMayTinh);
			this.groupBox1.Controls.Add(this.label4);
			this.groupBox1.Controls.Add(this.lblGioHienTai);
			this.groupBox1.Controls.Add(this.lblNgayHienTai);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.groupBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.groupBox1.Location = new System.Drawing.Point(8, 8);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(440, 248);
			this.groupBox1.TabIndex = 0;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Thông tin máy tính";
			// 
			// linkLabel1
			// 
			this.linkLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.linkLabel1.Location = new System.Drawing.Point(168, 216);
			this.linkLabel1.Name = "linkLabel1";
			this.linkLabel1.Size = new System.Drawing.Size(264, 24);
			this.linkLabel1.TabIndex = 29;
			this.linkLabel1.TabStop = true;
			this.linkLabel1.Text = "Xem chi tiết tại đây >>>>>";
			this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
			// 
			// lblDoPhanGiai
			// 
			this.lblDoPhanGiai.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.lblDoPhanGiai.Location = new System.Drawing.Point(176, 176);
			this.lblDoPhanGiai.Name = "lblDoPhanGiai";
			this.lblDoPhanGiai.Size = new System.Drawing.Size(256, 24);
			this.lblDoPhanGiai.TabIndex = 28;
			// 
			// label7
			// 
			this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.label7.Location = new System.Drawing.Point(16, 176);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(152, 24);
			this.label7.TabIndex = 27;
			this.label7.Text = "Độ phân giải màn hình:";
			this.label7.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// label3
			// 
			this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.label3.Location = new System.Drawing.Point(16, 152);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(152, 24);
			this.label3.TabIndex = 25;
			this.label3.Text = "Bộ vi xử lý:";
			this.label3.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// lblBoViXuLy
			// 
			this.lblBoViXuLy.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.lblBoViXuLy.Location = new System.Drawing.Point(128, 152);
			this.lblBoViXuLy.Name = "lblBoViXuLy";
			this.lblBoViXuLy.Size = new System.Drawing.Size(304, 24);
			this.lblBoViXuLy.TabIndex = 26;
			// 
			// label6
			// 
			this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.label6.Location = new System.Drawing.Point(16, 128);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(152, 24);
			this.label6.TabIndex = 24;
			this.label6.Text = "Công nghệ nền:";
			this.label6.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// lblCongNgheNen
			// 
			this.lblCongNgheNen.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.lblCongNgheNen.Location = new System.Drawing.Point(176, 128);
			this.lblCongNgheNen.Name = "lblCongNgheNen";
			this.lblCongNgheNen.Size = new System.Drawing.Size(256, 24);
			this.lblCongNgheNen.TabIndex = 23;
			// 
			// label5
			// 
			this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.label5.Location = new System.Drawing.Point(16, 104);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(152, 24);
			this.label5.TabIndex = 22;
			this.label5.Text = "Hệ điều hành:";
			this.label5.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// lblHeDieuHanh
			// 
			this.lblHeDieuHanh.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.lblHeDieuHanh.Location = new System.Drawing.Point(176, 104);
			this.lblHeDieuHanh.Name = "lblHeDieuHanh";
			this.lblHeDieuHanh.Size = new System.Drawing.Size(256, 24);
			this.lblHeDieuHanh.TabIndex = 21;
			// 
			// label2
			// 
			this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.label2.Location = new System.Drawing.Point(16, 80);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(152, 24);
			this.label2.TabIndex = 20;
			this.label2.Text = "Tên máy tính:";
			this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// lblTenMayTinh
			// 
			this.lblTenMayTinh.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.lblTenMayTinh.Location = new System.Drawing.Point(176, 80);
			this.lblTenMayTinh.Name = "lblTenMayTinh";
			this.lblTenMayTinh.Size = new System.Drawing.Size(256, 24);
			this.lblTenMayTinh.TabIndex = 19;
			// 
			// label4
			// 
			this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.label4.Location = new System.Drawing.Point(16, 56);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(152, 24);
			this.label4.TabIndex = 18;
			this.label4.Text = "Giờ hiện tại:";
			this.label4.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// lblGioHienTai
			// 
			this.lblGioHienTai.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.lblGioHienTai.Location = new System.Drawing.Point(176, 56);
			this.lblGioHienTai.Name = "lblGioHienTai";
			this.lblGioHienTai.Size = new System.Drawing.Size(256, 24);
			this.lblGioHienTai.TabIndex = 17;
			// 
			// lblNgayHienTai
			// 
			this.lblNgayHienTai.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.lblNgayHienTai.Location = new System.Drawing.Point(176, 32);
			this.lblNgayHienTai.Name = "lblNgayHienTai";
			this.lblNgayHienTai.Size = new System.Drawing.Size(256, 24);
			this.lblNgayHienTai.TabIndex = 16;
			// 
			// label1
			// 
			this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.label1.Location = new System.Drawing.Point(16, 32);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(152, 24);
			this.label1.TabIndex = 15;
			this.label1.Text = "Ngày hiện tại:";
			this.label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// ThongTinMayTinh
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(458, 263);
			this.Controls.Add(this.groupBox1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.MaximizeBox = false;
			this.Name = "ThongTinMayTinh";
			this.Text = "Xem thong tin may tinh cua ban";
			this.Load += new System.EventHandler(this.ThongTinMayTinh_Load);
			this.groupBox1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion


		// Thông tin máy tính của bạn
		private void ThongTinMayTinh_Load(object sender, System.EventArgs e)
		{
			lblNgayHienTai.Text = "Ngày " + DateTime.Now.Day.ToString() + ", tháng " + DateTime.Now.Month.ToString() + ", năm " + DateTime.Now.Year.ToString();
			lblGioHienTai.Text = DateTime.Now.Hour.ToString() + " giờ, " + DateTime.Now.Minute.ToString() + " phút, " + DateTime.Now.Second.ToString() + " giây";
			lblTenMayTinh.Text = Environment.MachineName.ToString();
			lblHeDieuHanh.Text = Environment.OSVersion.ToString();
			System.OperatingSystem os = Environment.OSVersion;
			lblCongNgheNen.Text = os.Platform.ToString();
			RegistryKey rk = Registry.LocalMachine;
			rk = rk.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
			lblBoViXuLy.Text = rk.GetValue("ProcessorNameString").ToString();
			lblDoPhanGiai.Text = SystemInformation.PrimaryMonitorSize.ToString();
			System.Diagnostics.Process p = Process.GetCurrentProcess();
		}


		// Mở DirectX Diagnostic Tool
		private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
		{
			Dxdiag frmDxdiag = new Dxdiag();
			frmDxdiag.Show();
		}


	}
}
